#include "RasterizerStateDX10.h"

CRasterizerStateDX10::CRasterizerStateDX10( )
{
    m_pRS                          = NULL;
    m_RSDesc.DepthClipEnable       = false;
    m_RSDesc.FrontCounterClockwise = true;
    m_RSDesc.MultisampleEnable     = false;
    m_RSDesc.ScissorEnable         = false;
    m_RSDesc.DepthBiasClamp        = 0.0f;
    m_RSDesc.DepthClipEnable       = true;
}

void CRasterizerStateDX10::Setup( )
{
    if (m_bNeedUpdate)
    {
        SAFE_RELEASE(m_pRS);
        m_RSDesc.FillMode              = (D3D10_FILL_MODE)m_uFillMode;
        m_RSDesc.CullMode              = (D3D10_CULL_MODE)m_uCullMode;
        m_RSDesc.DepthBias             = m_iDepthBias;
        m_RSDesc.AntialiasedLineEnable = m_bAntialiasedLineEnable;
        m_RSDesc.SlopeScaledDepthBias  = m_fSlopeScaledDepthBias;
        g_D3DDevice.pD3D10Device->CreateRasterizerState(&m_RSDesc, &m_pRS);
    }
    g_D3DDevice.pD3D10Device->RSSetState(m_pRS);
}